﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.NetworkInformation;

namespace SMDS.Helper
{
    class PingHelper
    {
        public static long Ping(string IP)
        { 
            Ping ping = new Ping();
            try
            {


                PingReply pingReply = ping.Send(IP);
             
                return pingReply.Status == IPStatus.Success ? pingReply.RoundtripTime : -1;
            }
            catch
            {}
            return -1;
        }
    }
}
